package org.spring.application.service;


import org.spring.spring.anno.Aspect;
import org.spring.spring.anno.Component;
import org.spring.spring.anno.Resource;
import org.spring.spring.aware.BeanNameAware;
import org.spring.spring.init.InitializingBean;

/**
 * @projectName: sky-springboot
 * @package: org.sky.application.service
 * @className: ApiService
 * @author: zhl
 * @description: TODO
 * @date: 2024/3/13 17:03
 * @version: 1.0
 */
@Component("apiService")
@Aspect
public class ApiService implements BeanNameAware, InitializingBean {

    @Resource
    private OrderService orderService;
    @Resource
    private UserService userService;
    @Resource
    private ApiService apiService;

    private String beanName;

    public void getField(){
        System.out.println("apiService打印beanName：" + beanName);
        System.out.println("apiService打印属性userService的bean对象：" + userService);
        System.out.println("apiService打印属性orderService的bean对象：" + orderService);
        System.out.println("apiService打印属性apiService的bean对象：" + apiService);
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
        System.out.println("apiService类回调获取beanName：" + beanName);
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println("apiService类的Aware回调，在属性赋值之后，在bean对象初始化之前");
    }
}
